<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/warehouse/warehouse/Ware_ReturnMaterials.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/warehouse/warehouse/Ware_ReturnMaterials.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ReturnMaterialsID',
                footer: "Foots",
                cnName: '退料单',
                name: 'warehouse/Ware_ReturnMaterials',
                url: "/Ware_ReturnMaterials/",
                sortName: "ReturnMaterialsID"
            });
            const editFormFields = ref({"ReturnProductCode":"","ProductCode":"","ProductName":"","ProductStandard":"","ReturnMaterialsMan":"","ReturnMaterialsQnty":"","Remark":""});
            const editFormOptions = ref([[{"dataKey":"orderNum","data":[],"title":"退料订单","field":"ReturnProductCode","type":"select"},
                               {"dataKey":"empty","data":[],"title":"产品编号","required":true,"field":"ProductCode","type":"select"}],
                              [{"title":"产品名称","required":true,"field":"ProductName","disabled":true,"type":"text"},
                               {"title":"产品规格","field":"ProductStandard","disabled":true,"type":"text"}],
                              [{"title":"退料人","required":true,"field":"ReturnMaterialsMan","type":"text"},
                               {"title":"退料数量","required":true,"field":"ReturnMaterialsQnty","type":"number"}],
                              [{"title":"备注","field":"Remark","type":"textarea"}]]);
            const searchFormFields = ref({"ReturnProductCode":"","ProductCode":"","ProductName":"","ReturnMaterialsMan":""});
            const searchFormOptions = ref([[{"dataKey":"orderNum","data":[],"title":"退料订单","field":"ReturnProductCode","type":"text"},{"dataKey":"empty","data":[],"title":"产品编号","field":"ProductCode","type":"text"}],[{"title":"产品名称","field":"ProductName","type":"text"},{"title":"退料人","field":"ReturnMaterialsMan","type":"text"}]]);
            const columns = ref([{field:'ReturnMaterialsID',title:'退料单ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ReturnMaterialsCode',title:'退料单号',type:'string',width:220,hidden:true,require:true,align:'left'},
                       {field:'ReturnProductCode',title:'退料订单',type:'string',bind:{ key:'orderNum',data:[]},width:220,align:'left',sort:true},
                       {field:'ProductCode',title:'产品编号',type:'string',bind:{ key:'empty',data:[]},width:220,require:true,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',width:220,readonly:true,require:true,align:'left'},
                       {field:'ProductStandard',title:'产品规格',type:'string',width:180,readonly:true,align:'left'},
                       {field:'ReturnMaterialsMan',title:'退料人',type:'string',width:220,require:true,align:'left'},
                       {field:'ReturnMaterialsQnty',title:'退料数量',type:'int',width:110,require:true,align:'left'},
                       {field:'ReturnMaterialsStash',title:'退料仓库',type:'string',width:220,hidden:true,align:'left'},
                       {field:'BState',title:'状态',type:'int',bind:{ key:'inStoreState',data:[]},width:110,hidden:true,require:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'CreateDate',title:'新增时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'CreateID',title:'新增人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'新增人名称',type:'string',width:130,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人名称',type:'string',width:130,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:110,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'MatType',title:'退料物料类别',type:'int',width:80,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
